Creating plug-ins for MacMail is simple if you know the HyperTalk programming language. This is because, roughly, MacMail plugins are plain text files with HyperTalk code.
Plug-in file description
File Type: ╥Plug╙
File Creator: ╥MMcl╙
The first line of your plugin looks (exactly) like this:
-- V0
(that╒s a zero). This is the verison of the plug-in structure. It allows me to make more advanced plug-in structures in the future that won╒t create incompatabilities with the current MacMail.
If you get that line wrong, you get this error:
╩
After that, the code starts. This is plain HyperTalk code, but you have access to the following XCMDs/XFCNs:
XCMDs
ListWindow
WindName
xDialog
CreateFolder
NewAnswer <╤ Use this one for all your alert dialogs! Syntax: http://welcome.to/kalleboo/
Balloons()
ShowList()
FindFolder()
GetDir()
hasAppearance()
How to access the messages:
listMessages() -- Returns a list of message subjects
listMessageIDs() -- Returns a list of message IDs
listMessageFolder(folder name) -- Returns a list of the messages in the folder specified. The global ╥FolderMessageIDs╙ is set to a list of the message IDs
saveFolders listOfFolders --replaces the list of folders with the list specified.
readFolders() -- Returns a list of the folders
saveMessage subject, from, to, date, folder, read, bodyText --saves a new message with those properites. Returns the message ID
readMessage whatToRead, ID --Reads a part of a message, can be: "subject", "from", "to", "date", "folder", "read", "body╙
moveMsg ID, where --Moves a message into a folder
markMsg ID -- Marks a message as read
deMarkMsg ID-- Marks a message as unread
Error handling
If your code hits upon an error, MacMail will stop the execution, and slap an error dialog:
╩
You might want to try to do alot of error checking yourself, so you can collect more diagnostic information.
Good Idea:
If you make a plug-in, tell me (kalleboo@yahoo.com) and it might even be included in the MacMail package!
Installing plug-ins:
Pop the plug-in file into the ╥MacMail╙ folder in the ╥Applications Support╙ folder in the system folder.
If you╒re using an OS older than 8.0, it╒ll be directly in the System Folder.
File name constraints:
No commas in the filename. No carriage return in the filename. (a.k.a. return) Nothin gelse freakt in the filename.